const http = require("http");
let options = {
    hostname: '192.168.174.166',
    port: 3000,
    pathname: "/postdata",
    method: 'POST'
}
let req = http.request(options, (res) => {
    let str = "";
    res.on("data", (chunk) => {
        str += chunk;

    })
    res.on("end", () => {
        console.log(str)
    })

})
let userInfor = {
    "username": "zhangsan",
    "password": 20
}
req.write(JSON.stringify(userInfor));
req.end();
console.log("post请求")
//发post请求


